#!/usr/bash

[ -f path.sh ] && . ./path.sh;
#. parse_options.sh || exit 1;

if [ $# -lt 3  ];then
	echo $0 "<data>  <src_dir> <dest_dir>\n"
	echo $0 "exp/tri1a   dest_dir"
	exit -1
fi


data=$1
src_dir=$2
dest_dir=$3

if [ ! -f $src_dir/final.mdl ];then
	echo 'final.mdl is not exists !'
	exit -1
fi

final_mdl=$src_dir/final.mdl

if [ ! -d $dest_dir ]; then 
	mkdir -p $dest_dir
fi
echo 'copy trans model'
copy-transition-model  --binary=true $final_mdl $dest_dir/final.trans.mdl
echo 'copy tree'
cp -f $src_dir/tree $dest_dir
echo 'copy global_cmvn.stats'

[ -f $data/global_cmvn.stats ] && cp -f $data/global_cmvn.stats $dest_dir


for file in $dest_dir/final.trans.mdl $dest_dir/tree  $dest_dir/global_cmvn.stats
do
	if [ -e $file ];then
		echo $file 'Done.'
	else 
		echo $file 'is not exists, you may copy it manually.'
fi
done